{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/components/DialogInput/index.tsx\",\n  _s = $RefreshSig$();\nimport React, { useEffect } from \"react\";\nimport { IconButton, Paper, TextField } from \"@mui/material\";\nimport classNames from \"classnames\";\nimport './DialogInput.scss';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst DialogInput = props => {\n  _s();\n  const [value, setValue] = React.useState(false);\n  const [textField, setTextField] = React.useState('');\n  const maxSizeMessage = 500;\n  useEffect(() => {\n    if (textField.length > 0) {\n      setValue(true);\n    } else {\n      setValue(false);\n    }\n  }, [textField]);\n  return /*#__PURE__*/_jsxDEV(Paper, {\n    component: \"form\",\n    className: \"dialogInput-form\",\n    children: [/*#__PURE__*/_jsxDEV(IconButton, {\n      type: \"button\",\n      className: \"dialogInput-form-smile\"\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 25,\n      columnNumber: 25\n    }, this), /*#__PURE__*/_jsxDEV(TextField, {\n      className: classNames(\"dialogInput-form-input\", {\n        \"dialogInput-form-input--error\": textField.length > maxSizeMessage\n      }),\n      onChange: e => setTextField(e.target.value),\n      variant: \"outlined\",\n      label: textField.length > 0 && `${textField.length}/${maxSizeMessage}` || null,\n      multiline: true,\n      rows: textField.length > maxSizeMessage * 0.05 ? 3 : 1,\n      placeholder: \"\\u0412\\u0432\\u0435\\u0434\\u0438\\u0442\\u0435 \\u0441\\u043E\\u043E\\u0431\\u0449\\u0435\\u043D\\u0438\\u0435\",\n      inputProps: {\n        'aria-label': 'Введите сообщение'\n      }\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 29,\n      columnNumber: 25\n    }, this), /*#__PURE__*/_jsxDEV(IconButton, {\n      type: \"button\",\n      className: \"dialogInput-form-image\"\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 41,\n      columnNumber: 25\n    }, this), /*#__PURE__*/_jsxDEV(IconButton, {\n      type: \"button\",\n      className: \"dialogInput-form-document\"\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 45,\n      columnNumber: 25\n    }, this), value && /*#__PURE__*/_jsxDEV(IconButton, {\n      type: \"button\",\n      className: \"dialogInput-form-send\"\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 51,\n      columnNumber: 33\n    }, this) || /*#__PURE__*/_jsxDEV(IconButton, {\n      type: \"button\",\n      className: \"dialogInput-form-microphone\"\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 55,\n      columnNumber: 34\n    }, this)]\n  }, void 0, true, {\n    fileName: _jsxFileName,\n    lineNumber: 24,\n    columnNumber: 17\n  }, this);\n};\n_s(DialogInput, \"uXhpKGo320fqSa9sZCHsU9+LM8w=\");\n_c = DialogInput;\nexport default DialogInput;\nvar _c;\n$RefreshReg$(_c, \"DialogInput\");","map":{"version":3,"names":["React","useEffect","IconButton","Paper","TextField","classNames","DialogInput","props","value","setValue","useState","textField","setTextField","maxSizeMessage","length","e","target"],"sources":["/data/messenger.client/src/components/DialogInput/index.tsx"],"sourcesContent":["import React, {useEffect} from \"react\";\nimport {IconButton, Paper, TextField} from \"@mui/material\";\nimport {DialogInputProps} from \"../../models/props/DialogInputProps\";\nimport classNames from \"classnames\";\nimport data from '@emoji-mart/data';\nimport {Picker} from 'emoji-mart/react';\nimport './DialogInput.scss';\n\nconst DialogInput: React.FC<DialogInputProps> = (props) => {\n    const [value, setValue] = React.useState<boolean>(false);\n    const [textField, setTextField] = React.useState<string>('');\n\n    const maxSizeMessage = 500;\n\n    useEffect(() => {\n        if (textField.length > 0) {\n            setValue(true);\n        } else {\n            setValue(false);\n        }\n    }, [textField]);\n\n        return (\n                <Paper component=\"form\" className=\"dialogInput-form\">\n                        <IconButton\n                            type=\"button\"\n                            className='dialogInput-form-smile'\n                        />\n                        <TextField\n                            className={classNames(\"dialogInput-form-input\", {\n                                \"dialogInput-form-input--error\": textField.length > maxSizeMessage\n                            })}\n                            onChange={e => (setTextField(e.target.value))}\n                            variant=\"outlined\"\n                            label={((textField.length > 0 && `${textField.length}/${maxSizeMessage}`) || null)}\n                            multiline\n                            rows={(textField.length > maxSizeMessage * 0.05)? 3: 1}\n                            placeholder=\"Введите сообщение\"\n                            inputProps={{ 'aria-label': 'Введите сообщение' }}\n                        />\n                        <IconButton\n                            type=\"button\"\n                            className='dialogInput-form-image'\n                        />\n                        <IconButton\n                            type=\"button\"\n                            className='dialogInput-form-document'\n                        />\n                        {\n                            (value &&\n                                <IconButton\n                                    type=\"button\"\n                                    className='dialogInput-form-send'\n                                />) ||\n                                (<IconButton\n                                    type=\"button\"\n                                    className='dialogInput-form-microphone'\n                                />)\n                        }\n            </Paper>\n        );\n}\n\nexport default DialogInput;"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,SAAS,QAAO,OAAO;AACtC,SAAQC,UAAU,EAAEC,KAAK,EAAEC,SAAS,QAAO,eAAe;AAE1D,OAAOC,UAAU,MAAM,YAAY;AAGnC,OAAO,oBAAoB;AAAC;AAE5B,MAAMC,WAAuC,GAAIC,KAAK,IAAK;EAAA;EACvD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGT,KAAK,CAACU,QAAQ,CAAU,KAAK,CAAC;EACxD,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGZ,KAAK,CAACU,QAAQ,CAAS,EAAE,CAAC;EAE5D,MAAMG,cAAc,GAAG,GAAG;EAE1BZ,SAAS,CAAC,MAAM;IACZ,IAAIU,SAAS,CAACG,MAAM,GAAG,CAAC,EAAE;MACtBL,QAAQ,CAAC,IAAI,CAAC;IAClB,CAAC,MAAM;MACHA,QAAQ,CAAC,KAAK,CAAC;IACnB;EACJ,CAAC,EAAE,CAACE,SAAS,CAAC,CAAC;EAEX,oBACQ,QAAC,KAAK;IAAC,SAAS,EAAC,MAAM;IAAC,SAAS,EAAC,kBAAkB;IAAA,wBAC5C,QAAC,UAAU;MACP,IAAI,EAAC,QAAQ;MACb,SAAS,EAAC;IAAwB;MAAA;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